import { App } from 'vue'
import { createRouter, createWebHistory } from 'vue-router'
import guard from './guard'
import routes from './routes'
const router = createRouter({
	history: createWebHistory(),
	routes,
	scrollBehavior() {
		return { top: 0 }
	},
})

export async function setupRouter(app: App) {
	guard(router)
	app.use(router)
	await router.isReady()
}
